SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
create view [dbo].[docentesnuevosecundario]
as
select distinct tb_asignaturas.descripcion,agente,count(*)as cargos from vw_pofpaquetes vw inner join tb_plazas p on p.cupof = vw.cupof inner join tb_asignaturas on idasignatura = asignatura  where p.cuise in(2301,
2302,2303,2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2315,2316,2317,2318,2319,2320,2321,2322,2324,
2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2360,2361,2392,2393,2394,2368,2347,2348,2350,2351,2352,2353,
2354,2356,2358,2362,2363,2364,2372,2373,2374,2375,2376,2379,2382,2383,2384,2385,2386,2387,2389,2395,2396,2397,
2401,2402,2403,2404,2405,2406,2407,2408,2409,2451,2452,2453,2454,2455,2456,2457,2458,2462,2390,2391) group by tb_asignaturas.descripcion,agente
/*
select * from tb_plazas inner join tb_asignaturas on idasignatura = asignatura where cuise in (2301,
2302,2303,2304,2305,2306,2307,2308,2309,2310,2311,2312,2313,2314,2315,2316,2317,2318,2319,2320,2321,2322,2324,
2325,2326,2327,2328,2329,2330,2331,2332,2333,2334,2360,2361,2392,2393,2394,2368,2347,2348,2350,2351,2352,2353,
2354,2356,2358,2362,2363,2364,2372,2373,2374,2375,2376,2379,2382,2383,2384,2385,2386,2387,2389,2395,2396,2397,
2401,2402,2403,2404,2405,2406,2407,2408,2409,2451,2452,2453,2454,2455,2456,2457,2458,2462,2390,2391)
*/
GO
